import request from '@/utils/request'


export function deviceManagementTree() { //设备管理-第一层树查询
    return request({
        url: '/project-quality/api/equipmentInfo/facilityList',
        method: 'GET',
    })
}
export function deviceManagementTreeLazy(id) { //设备管理-树懒加载
    return request({
        url: '/project-quality/api/equipmentInfo/facilityTree/' + id,
        method: 'GET',
    })
}

export function deviceManagementList(data) { //设备管理-设备表
    return request({
        url: '/project-quality/api/equipmentInfo/page',
        method: 'POST',
        data,
    })
}

export function deviceManagementAdd(data) { //设备管理-设备新增
    return request({
        url: '/project-quality/api/equipmentInfo/save',
        method: 'POST',
        data,
    })
}
//原 put
export function deviceManagementEdit(data) { //设备管理-编辑
    return request({
        url: '/project-quality/api/equipmentInfo/put/update',
        method: 'post',
        data
    })
}
//原 del
export function deviceManagementDelete(id) { //设备管理-删除
    return request({
        url: '/project-quality/api/equipmentInfo/delete/del/' + id,
        method: 'get',
    })
}
export function deviceManagementDetails(id) { //设备管理-详情
    return request({
        url: '/project-quality/api/equipmentInfo/' + id,
        method: 'get',
    })
}
export function deviceManagementExport(data) { //设备管理-设备、设施设备树导出
    return request({
        url: '/project-quality/api/equipmentInfo/export',
        responseType: 'arraybuffer',
        method: 'POST',
        data,
    })
}

export function deviceManagementDetailsByEdis(params) { //设备管理-通过EDIS编码查详情
    return request({
        url: '/project-quality/api/equipmentInfo/edis',
        method: 'get',
        params
    })
}


/**
 * cate是台账管理设备的
 */
export function deviceManagementCateTree() { //设备cate管理-第一层树查询
    return request({
        url: '/project-quality/api/equipmentInfo/tree/facilityList',
        method: 'GET',
    })
}

export function deviceManagementCateTreeLazy(id) { //设备管理-树懒加载
    return request({
        url: '/project-quality/api/equipmentInfo/tree/facilityTree/' + id,
        method: 'GET',
    })
}
export function deviceManagementCateList(data) { //设备管理-分级台账
    return request({
        url: '/project-quality/api/equipmentInfo/tree/page',
        method: 'POST',
        data,
    })
}
export function deviceManagementCateExport(data) { //设备管理-设备、设施设备树导出
    return request({
        url: '/project-quality/api/equipmentInfo/tree/export',
        responseType: 'arraybuffer',
        method: 'POST',
        data,
    })
}

